home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / SimplePeer / modDPlay.bas < prev    next >
BASIC Source File  |  2001-10-08  |  1KB  |  39 lines

  1. Attribute VB_Name = "modDPlay"
  2. Option Explicit
  3. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  4. '
  5. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  6. '
  7. '  File:       modDPlay.bas
  8. '
  9. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  10.  
  11. ' Win32 declares
  12. Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
  13.  
  14. 'Constants
  15. Public Const AppGuid = "{74377695-900D-4fdb-98F7-AC6BCAD2C631}"
  16.  
  17. Public dx As DirectX8
  18. Public dpp As DirectPlay8Peer
  19. Public glNumPlayers As Long
  20.  
  21. Public gfHost As Boolean
  22. Public DPlayEventsForm As DPlayConnect
  23.  
  24. Public Sub InitDPlay()
  25.     Set dx = New DirectX8
  26.     Set dpp = dx.DirectPlayPeerCreate
  27. End Sub
  28.  
  29. Public Sub Cleanup()
  30.     If Not dpp Is Nothing Then dpp.UnRegisterMessageHandler 'Stop taking messages
  31.     'Close our peer connection
  32.     If Not dpp Is Nothing Then dpp.Close
  33.     'Lose references to peer and dx objects
  34.     Set dpp = Nothing
  35.     Set dx = Nothing
  36.     DPlayEventsForm.GoUnload
  37. End Sub
  38.  
  39.